package com.mi.queryhivedemo.dao;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class TestDao{

    @Autowired
    @Qualifier("hiveJdbcTemplate")
    private JdbcTemplate jdbcTemplate;

    public String test(String sql) {
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        System.out.println("=======================");
        System.out.println(list.toString());
        System.out.println("=======================");
        return list.toString();
    }
}
